package eventtest 
{
	import flash.display.Sprite;
	import flash.utils.setTimeout;
	import iscript.gameFramework.GameLite.Game;
	import iscript.gameFramework.GameLite.directEvent.DirectEventParameter;
	
	
	public class EventManagerTEST extends Sprite
	{
		public var  action1:GameEventAction1 = new GameEventAction1();
		public var data:GameEventData = new GameEventData()
		public function EventManagerTEST() 
		{
			
			var game:Game = new Game(stage);
				//Game.IsDebugMode = false;
					
	         addChild(new EA())
			
				
			data.name = "raymond"
			
			
			
			
		 	Game.DirectEvent.receive("1-1", testFn);

			Game.DirectEvent.send("1-1", data);
 
			trace("==============")
/*			 var node1:EventReceiver = new EventReceiver("Node1");
       var node11:EventReceiver = new EventReceiver("Node11");
       var node12:EventReceiver = new EventReceiver("Node12");
       var node121:EventReceiver = new EventReceiver("Node121");
       var node13:EventReceiver = new EventReceiver("Node13");
       var node2:EventReceiver = new EventReceiver("Node12");

       this.addChild(node1);
       this.addChild(node2);

       node1.addChild(node11);
       node1.addChild(node12);
       node1.addChild(node13);
       node12.addChild(node121);
	   
	   
	   
       node12.sendEvent();*/
		
	   setTimeout(function():void {
		   data.name="iscript"
			        Game.DirectEvent.receive("1-1", action1);	 
					Game.DirectEvent.send("1-1", data);
					Game.DirectEvent.send("2-1", data);
						},3000);
						
						
								
	   }
		
		public function testFn(e:GameEventData):void {
			      trace("testFn",e.name);
			 	  Game.DirectEvent.destroy("1-1", testFn);
			}
			
 
		
	}

}